﻿<Page x:Class="App15.MainPage"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
      xmlns:local="using:App15"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
      Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
      mc:Ignorable="d">

    <Page.DataContext>
        <local:ViewModel />
    </Page.DataContext>

    <Grid Background="#FF1F1F1F">
        <Panel.Resources>
            <Style TargetType="Rectangle">
                <Setter Property="Width" Value="100" />
                <Setter Property="Height" Value="100" />
                <Setter Property="Margin" Value="10" />
                <Setter Property="RenderTransformOrigin" Value=".5,.5" />
            </Style>
        </Panel.Resources>

        <Rectangle Fill="Red">
            <Rectangle.RenderTransform>
                <CompositeTransform ScaleX="3"
                                    ScaleY="3"
                                    TranslateX="{Binding Level1X}"
                                    TranslateY="{Binding Level1Y}" />
            </Rectangle.RenderTransform>
        </Rectangle>
        <Rectangle Fill="Blue">
            <Rectangle.RenderTransform>
                <CompositeTransform ScaleX="2"
                                    ScaleY="2"
                                    TranslateX="{Binding Level2X}"
                                    TranslateY="{Binding Level2Y}" />
            </Rectangle.RenderTransform>
        </Rectangle>
        <Rectangle Fill="Yellow">
            <Rectangle.RenderTransform>
                <CompositeTransform ScaleX="1"
                                    ScaleY="1"
                                    TranslateX="{Binding Level3X}"
                                    TranslateY="{Binding Level3Y}" />
            </Rectangle.RenderTransform>
        </Rectangle>

    </Grid>

</Page>